fix pgsql import - don't end psql import prematurely, install gzip on sles (for zcat), move sql file path to defaults #148
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
PR progress checklist (to be filled in by reviewers)
What type of PR is this?
Primary type
[fix]
A bug fixDoes this PR introduce a
BREAKING CHANGE
?No.
Related issues and/or pull requests
#147
Describe the changes you're proposing
head -5 after psql does end the pswl import prematurely with EPIPE, so we need to wait for the command to end.
removed for now, will be in separate pullrequest
when dbroot_user and dbroot_pass is defined, it runs psql as user nobody, which is not guaranteed to exist on all distros. i suggest using zabbix.user, which does exist as we already installed zabbix (so we can use the sql.gz file to import) resolved with the remake of the check, uses zabbix user nowinstall gzip on sles so we are sure zcat exists
move default path to sql file to defaults.yml, so it can be overriden in osfamilymap.yml and not only pillar
redone the check, so it uses psql after it is installed, similarly to what import does, not before.
Pillar / config required to test the proposed changes
remote db with dbroot_user and dbroot_pass set.
Debug log showing how the proposed changes work
removed, most relevant part moved to another pull